unsigned long mfn, unsigned long nr_mfns)
{
unsigned long i;
+ p2m_access_t a;
int rc;
+ a = p2m_get_hostp2m(d)->default_access;
for ( i = 0; i < nr_mfns; i++ )
{
- if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i))) )
+ if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i), a)) )
panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
gfn, mfn, i, rc);
if ( !(i & 0xfffff) )
share_xen_page_with_guest(virt_to_page(apic_va), d, XENSHARE_writable);
d->arch.hvm_domain.vmx.apic_access_mfn = virt_to_mfn(apic_va);
set_mmio_p2m_entry(d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE),
- _mfn(virt_to_mfn(apic_va)));
+ _mfn(virt_to_mfn(apic_va)), p2m_get_hostp2m(d)->default_access);
return 0;
}
/* Returns: 0 for success, -errno for failure */
static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
- p2m_type_t gfn_p2mt)
+ p2m_type_t gfn_p2mt, p2m_access_t access)
{
int rc = 0;
p2m_access_t a;
P2M_DEBUG("set %d %lx %lx\n", gfn_p2mt, gfn, mfn_x(mfn));
rc = p2m_set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, gfn_p2mt,
- p2m->default_access);
+ access);
gfn_unlock(p2m, gfn, 0);
if ( rc )
gdprintk(XENLOG_ERR,
static int set_foreign_p2m_entry(struct domain *d, unsigned long gfn,
mfn_t mfn)
{
- return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign);
+ return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign,
+ p2m_get_hostp2m(d)->default_access);
}
-int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
+int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
+ p2m_access_t access)
{
- return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct);
+ return set_typed_p2m_entry(d, gfn, mfn, p2m_mmio_direct, access);
}
/* Returns: 0 for success, -errno for failure */
for ( i = 0; !ret && i < nr; i++ )
{
- ret = set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i));
+ ret = set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i),
+ p2m_get_hostp2m(d)->default_access);
if ( ret )
{
unmap_mmio_regions(d, start_gfn, i, mfn);
unsigned long end);
/* Set mmio addresses in the p2m table (for pass-through) */
-int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
+int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
+ p2m_access_t access);
int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
/* Add foreign mapping to the guest's p2m table. */